<template>
<Modal v-model="modalEdit" fullscreen @on-cancel="handleModalEditCancel">
	<template #header>
		<Icon custom="iconfont icon-Word"/>&nbsp;处罚审批表&nbsp;
	</template>
	<div><Row justify="center"><Col span="16">
		<Card title="案件信息" icon="ios-bookmark">
			<template #extra>
				{{baseform.party_name}}&nbsp;&nbsp;&nbsp;涉嫌&nbsp;&nbsp;&nbsp;{{baseform.cause_name}}
			</template>
			<Alert show-icon>
				具体违法事实
				<template #desc>{{base.facts}} </template>
			</Alert>
			<Alert show-icon>
				相关证据
				<template #desc>{{base.proof}} </template>
			</Alert>
			<Alert show-icon>
				履行告知及当事人陈述申辩或者听证情况
				<template #desc>{{base.explain}} </template>
			</Alert>
			<Alert show-icon>
				处罚（拆除）依据
				<template #desc>{{baseform.regulation_detail}} </template>
			</Alert>
			<Alert show-icon>
				承办人意见-{{baseform.undertakername}}
				<template #desc>{{baseform.undertaker_opinion}} </template>
			</Alert>
			
		</Card>
		<br>
		<Card title="承办机构意见" icon="ios-bookmark">
			<template #extra>
				提交日期：<DatePicker v-model="baseform.date2" type="date" placeholder="选择日期" style="width: 200px"></DatePicker>
			</template>
			<Input v-model="baseform.org_opinion" maxlength="300" show-word-limit type="textarea" :rows="3"/>
		</Card>
	</Col></Row></div>
	<template #footer>
		<Row>
			<Col span="4">&nbsp;</Col>
			<Col span="4"><Button type="error" size="large" long  @click="handleModalEditBack">退回</Button></Col>
			<Col span="2">&nbsp;</Col>
			<Col span="10"><Button type="success" size="large" long @click="handleModalEditOK">审批通过</Button></Col>
			<Col span="4">&nbsp;</Col>
		</Row>	
	</template>
	<Spin size="large" fix :show="spinShow"></Spin>
</Modal>
</template>

<script>
import {dateUtils,appendDoc} from '@/libs/tools.js'
import config from '@/config'
export default{
	data(){
		return {
			modalEdit:true,
			legals:[],
			spinShow:false,
			baseform:{},
			base:{}//只用于显示
		}
	},
	methods:{
		handleModalEditCancel(){
			this.$router.go(-1)
		},
		handleModalEditBack(){
			let data={...this.baseform}
			data.date2=dateUtils.format2(data.date2)
			data.org_name=this.$store.state.user.userInfo.uid
			this.spinShow=true
			this.$axios.post('mainCase2BackDoc1822.action',data).then(res=>{
				this.spinShow=false
				window.open(config.baseUrl+res.data,'_blank')
				this.$router.go(-1)
			})
		},
		handleModalEditOK(){
			let data={...this.baseform}
			data.date2=dateUtils.format2(data.date2)
			data.org_name=this.$store.state.user.userInfo.uid
			this.spinShow=true
			this.$axios.post('mainCase2PassDoc1822.action',data).then(res=>{
				this.spinShow=false
				window.open(config.baseUrl+res.data,'_blank')
				this.$router.go(-1)
			})
			
		}
	},
	mounted(){
		this.$axios.post('mainCase1GetDoc209.action',{
			case_no:this.$route.query.case_no,
			party_type:this.$route.query.party_type
		}).then(res=>{
			this.baseform={...this.baseform,...res.data}
			dateUtils.dateNotNull(this.baseform,'date2')
		})
	}
}
</script>

<style>
</style>